#ifndef SCENETABLE_H
#define SCENETABLE_H

#include "scenemark.h"

#include <QWidget>

namespace Ui {
class SceneTable;
}

class SceneTable : public QWidget
{
    Q_OBJECT

public:
    explicit SceneTable(QWidget *parent = 0);
    void setScenePicFile(QString file);
    void setScenePic(QImage pic);
    void setSceneMarkSize(int x,int y,int size);
    void setConfig(bool isconfig);
    QList<SceneMark *> getScenes();
    QByteArray saveScenes();
    //void saveScenes(QString filename);
    void loadScenes(QString filename);
    void loadScenes(QByteArray &data);
    void clearScenes();
    void setConfig();
    ~SceneTable();

signals:
    void chvalue_changed(float value);
    void chstate_changed(int state);

private:
    QString image_file;
    QImage pic_image;
    int maxID;
    Ui::SceneTable *ui;
    QList<SceneMark *> list_scene;
    bool isConfig;
    int lastWidth;
    int lastHight;
    //void addScenesMark(SceneMark mark);
    void addScenesMark(SceneMark *mark);
    void maxIDChanged(int newid);

private slots:
    void maxIDadd(int newid);

    // QWidget interface
protected:
    void resizeEvent(QResizeEvent *);

    // QWidget interface
protected:
    void dragEnterEvent(QDragEnterEvent *event);
    void dropEvent(QDropEvent *event);
    void mousePressEvent(QMouseEvent *event);

};

#endif // SCENETABLE_H
